/**
 * 
 */
package hawk.example;

import java.time.LocalDate;

import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.params.aggregator.ArgumentsAccessor;
import org.junit.jupiter.params.aggregator.ArgumentsAggregationException;
import org.junit.jupiter.params.aggregator.ArgumentsAggregator;

import hawk.example.juni5.Gender;
import hawk.example.juni5.Person;

/**
 * @author Hawk
 *
 */
public class PersonAggregator implements ArgumentsAggregator {

	@Override
	public Object aggregateArguments(ArgumentsAccessor arguments, ParameterContext context) throws ArgumentsAggregationException {
		return new Person(arguments.getString(0), //
				arguments.getString(1), //
				arguments.get(2, Gender.class), //
				arguments.get(3, LocalDate.class));
	}

}
